<?php

class GoogleMap {
	
	var $APIKey = 'AIzaSyCnvYrnc3yMt9GumxG1N8WG_DQX2Wdhwgg'; //Код Google API
	var $DefaultLatitude = 28.314053; //Начальная долгота
	var $DefaultLongitude = -16.505814; //Начальная широта
	var $DefaultZoom = 10; //Начальный масштаб
	var $DefaultMapType = 'ROADMAP'; //ROADMAP displays the normal, default 2D tiles of Google Maps; SATELLITE displays photographic tiles; HYBRID displays a mix of photographic tiles and a tile layer for prominent features (roads, city names); TERRAIN displays physical relief tiles for displaying elevation and water features (mountains, rivers, etc.).
	var $DefaultLanguage = 'ru';
	var $DefaultRegion = 'ES';

	
	function __construct($Language = 'ru') {
		
		if(isset($Language)) {
			$this->DefaultLanguage = $Language;
		}

		echo('Lan: '.$this->DefaultLatitude.' Lng: '.$this->DefaultLongitude.' Zoom: '.$this->DefaultZoom);
		
		echo('<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key='.$this->APIKey.'&sensor=true&language='.$this->DefaultLanguage.'&region='.$this->DefaultRegion.'"></script>');
		echo('
		<script type="text/javascript">
		function initialize() {
			var myOptions = {
				center: new google.maps.LatLng('.$this->DefaultLatitude.', '.$this->DefaultLongitude.'),
				zoom: '.$this->DefaultZoom.',
				mapTypeId: google.maps.MapTypeId.'.$this->DefaultMapType.'
			};
			var map = new google.maps.Map(document.getElementById("map_canvas"),
			myOptions);
		}
		</script>
		');
	}
	
}

?>